package de.baumann.browser.activitys.hash

import android.content.Context
import android.content.Intent
import android.os.Bundle
import de.baumann.browser.R
import de.baumann.browser.adapter.PagerAdapter
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.fragments.PackRecordFragment
import de.baumann.browser.iview.IBaseView
import kotlinx.android.synthetic.main.activity_pack_record.*

/**
 *@author:junce
 *@date:2019/3/5 14:05
 *@discription: 红包记录
 */
class PackRecordActivity : BaseOdinActivity<IBaseView, BasePresenter<IBaseView>>() {

    override fun createPresenter(): BasePresenter<IBaseView>? {
        return null
    }

    override fun createView(): IBaseView? {
        return null
    }

    lateinit var receivePack: PackRecordFragment
    lateinit var sendedPack: PackRecordFragment

    companion object {
        fun startPackRecordActivity(context: Context) {
            context.startActivity(Intent(context, PackRecordActivity::class.java))
        }
    }

    override fun getLayout(): Int {
        return R.layout.activity_pack_record
    }

    override fun getTitleText(): String {
        return getString(R.string.Red_envelope_record)
    }

    override fun initView() {
        initToolbar(packRecordToolbar,null)

        val receiveBundle = Bundle()
        receiveBundle.putInt("status", 0)

        val sendBundle = Bundle()
        sendBundle.putInt("status", 1)

        receivePack = PackRecordFragment()
        sendedPack = PackRecordFragment()
        receivePack.arguments = receiveBundle
        sendedPack.arguments = sendBundle

        val fragments = arrayListOf(receivePack, sendedPack)
        val adapter = PagerAdapter(supportFragmentManager, fragments, arrayOf(getString(R.string.Receivingrecords), getString(R.string.Sentrecord)))
        viewpageRecord.adapter = adapter
        pakcRecordTab.setupWithViewPager(viewpageRecord)
    }

    override fun initData() {
    }

}
